package cn.yunhe.service;

import cn.yunhe.dao.IDeptDao;
import cn.yunhe.entity.Dept;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

@Service("deptService")
public class DeptService {

    @Autowired
    @Qualifier("deptDao")
    private IDeptDao deptDao;

    public void addDept(Dept dept) {
        try {
            deptDao.addDept(dept);
        }catch (Exception e){
            throw new RuntimeException();
        }
    }

    public IDeptDao getDeptDao() {
        return deptDao;
    }

    public void setDeptDao(IDeptDao deptDao) {
        this.deptDao = deptDao;
    }
}
